package com.gitee.flwwsg.rpc.transport.command;

import lombok.Getter;
import lombok.Setter;

/**
 * 消息头部
 */
@Getter
@Setter
public class Header {
    //请求 id
    private int requestId;
    //版本
    private int version;
    //消息类型
    private int type;

    public Header() {};
    public Header(int type, int version, int requestId) {
        this.requestId = requestId;
        this.type = type;
        this.version = version;
    }

    public int length() {
        return Integer.BYTES * 3;
    }
}
